package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CarrierMapper;
import com.ruoyi.system.domain.Carrier;
import com.ruoyi.system.service.ICarrierService;

/**
 * 承运商Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-13
 */
@Service
public class CarrierServiceImpl implements ICarrierService 
{
    @Autowired
    private CarrierMapper carrierMapper;

    /**
     * 查询承运商
     * 
     * @param id 承运商主键
     * @return 承运商
     */
    @Override
    public Carrier selectCarrierById(Long id)
    {
        return carrierMapper.selectCarrierById(id);
    }

    /**
     * 查询承运商列表
     * 
     * @param carrier 承运商
     * @return 承运商
     */
    @Override
    public List<Carrier> selectCarrierList(Carrier carrier)
    {
        return carrierMapper.selectCarrierList(carrier);
    }

    /**
     * 新增承运商
     * 
     * @param carrier 承运商
     * @return 结果
     */
    @Override
    public int insertCarrier(Carrier carrier)
    {
        carrier.setCreateTime(DateUtils.getNowDate());
        return carrierMapper.insertCarrier(carrier);
    }

    /**
     * 修改承运商
     * 
     * @param carrier 承运商
     * @return 结果
     */
    @Override
    public int updateCarrier(Carrier carrier)
    {
        carrier.setUpdateTime(DateUtils.getNowDate());
        return carrierMapper.updateCarrier(carrier);
    }

    /**
     * 批量删除承运商
     * 
     * @param ids 需要删除的承运商主键
     * @return 结果
     */
    @Override
    public int deleteCarrierByIds(Long[] ids)
    {
        return carrierMapper.deleteCarrierByIds(ids);
    }

    /**
     * 删除承运商信息
     * 
     * @param id 承运商主键
     * @return 结果
     */
    @Override
    public int deleteCarrierById(Long id)
    {
        return carrierMapper.deleteCarrierById(id);
    }
}
